#include "widget.h"
#include "ui_widget.h"

Widget::Widget(QWidget *parent)
    : QWidget(parent)
    , ui(new Ui::Widget)
{
    ui->setupUi(this);
    setWindowTitle("测试鼠标事件程序");
    QLabel *label=new QLabel(this);
    QString path="D:/job/qt/work/teacher/day3/QMouseEventProssss/Luffy.png";

    QPixmap *map=new QPixmap;
    label->move(20,20);
    label->setFixedSize(700,400);
    if(map->load(path))
    {
        label->setPixmap(*map);

    }
    else
    {
        QMessageBox::information(this,"失败","加载图片失败，请重新检查？");
        delete map;
        return;
    }
}

Widget::~Widget()
{
    delete ui;
}

void Widget::mouseMoveEvent(QMouseEvent *event)
{

}

void Widget::mousePressEvent(QMouseEvent *event)
{

}

void Widget::mouseReleaseEvent(QMouseEvent *event)
{

}
